Using a Private S3 Bucket for Media Files

Description

TransForm can upload media files to your own private Amazon S3 bucket. Previously, media files were uploaded to an S3 bucket owned by Alpha Software.

Overview

You can configure TransForm to store uploaded media files in a private Amazon S3 bucket that you control.

To use a private bucket:

Configure the bucket CORS settings.

Open your TransForm account preferences in JSON mode.

Add an imageStorage definition to the account preferences JSON.

Before You Begin

Before configuring a private S3 bucket, make sure you have the required Amazon S3 bucket information, including the bucket name, region, access key, and secret key, or an existing S3 connection that can be referenced from the TransForm account settings.

Configure CORS on the Bucket

Before using a private bucket, you must configure the bucket CORS settings.

The exact CORS policy you use depends on your deployment and security requirements.

If the bucket CORS settings are not configured correctly, media uploads may fail.

Open Account Preferences in JSON Mode

To edit the TransForm account preferences in JSON mode, launch TransForm with the following query string:

?mode=dev

After launching TransForm in development mode, open the account preferences and switch to JSON mode.

Add the imageStorage Definition

Add an imageStorage key to the account preferences JSON.

You can define imageStorage using either direct bucket credentials or a named S3 connection.

Using Direct Bucket Credentials

The following example shows the imageStorage definition using the bucket credentials directly:

"imageStorage": {
    "AccessKey": "your bucket Access Key",
    "SecretKey": "your bucket secret key",
    "region": "bucket region",
    "container": "bucket name"
}

Using an Existing S3 Connection

Alternatively, you can configure an S3 connection and reference that connection in the imageStorage definition.

"imageStorage": {
    "accesskey": "connected:name of S3 connection"
}

Choosing a Configuration Method

Use direct bucket credentials if you want to specify the S3 access details explicitly in the account preferences JSON.

Use a named S3 connection if you already manage your S3 settings through a connection definition and want to reference that connection instead.

Notes

After the imageStorage definition has been added and saved, newly uploaded media files will use the configured private S3 bucket.

Protect all S3 credentials carefully. Limit access to account preference settings and use appropriate AWS security practices for credentials and bucket permissions.

See Also